const tongJi = {
  data(){
    return {
      searchForm:{
        year:new Date().getFullYear(),
        month:'',
        departmentId:'',
      },
      departmentList:[],
      yearList:[],
      monthList:[],
      dialog:{
        show:false
      },
      detailTableData:[],
      detailPage: {
        index:1,
        size:10,
        total:0
      },
      curSelected:''
    }
  },
  created() {
    this.getYear()
    this.getMonth()
    this.getDepartmentList()
  },
  methods:{
    getYear(){
      let curYear = new Date().getFullYear()
      this.yearList.push(curYear)
      for(let i=1;i<=5;i++){
        this.yearList.push(curYear-i)
      }
    },
    getMonth(){
      for(let i=1;i<=12;i++){
        this.monthList.push(i)
      }
    },
    showDetail(id){
      console.log(id)
      this.dialog.show = true
      this.curSelected = id
      this.getDetailList()
    },
/*    getDetailList(){
      /!*this.mixinParams.API.getListByUid(this.curSelected,this.searchForm.year,this.searchForm.month).then(res=>{
        this.detailTableData = res.records
        this.detailPage.total = res.total
      })*!/
    },*/
    handleSizeChangeDetail(val){
      this.detailPage.size = val
      this.getDetailList()
    },
    handleCurrentChangeDetail(val){
      this.detailPage.index = val
      this.getDetailList()
    }
  }
}

export default tongJi
